package com.dtb.trade.config.mongodb;

import org.springframework.boot.autoconfigure.mongo.MongoProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @Author:ChengJian
 * @Description:
 * @Date: Created in 下午2:46 2018/8/15
 */
@Configuration
public class MultipleMongoProperties {

    @Bean(name="firstMongoProperties")
    @Primary
    @ConfigurationProperties(prefix="spring.data.mongodb.first")
    public MongoProperties firstMongoProperties() {
        return new MongoProperties();
    }

    @Bean(name="secondMongoProperties")
    @ConfigurationProperties(prefix="spring.data.mongodb.second")
    public MongoProperties secondMongoProperties() {
        return new MongoProperties();
    }

    @Bean(name="thirdMongoProperties")
    @ConfigurationProperties(prefix="spring.data.mongodb.third")
    public MongoProperties thirdMongoProperties() {
        return new MongoProperties();
    }

    @Bean(name="fourthMongoProperties")
    @ConfigurationProperties(prefix="spring.data.mongodb.fourth")
    public MongoProperties fourthMongoProperties() {
        return new MongoProperties();
    }
}
